package cn.service;
import java.util.List;
import javax.annotation.Resource;
import javax.transaction.Transactional;

import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;
import cn.dao.ItemDao;
import cn.pojo.Item;
@Service
public class ItemServiceImpl implements ItemService {
	@Resource
	private ItemDao itemDao;
	@Override
	@Transactional
	public void save(Item item) {
		itemDao.save(item);
	}
	@Override
	public List<Item> findAll(Item item) {
		//声明查询条件
		Example<Item> example = Example.of(item);
		List<Item> list = itemDao.findAll(example);
		return list;
	}
}
